package dao;

import com.example.skycode6.utill.DBConnection;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLClientInfoException;
import java.sql.SQLException;

public class AdminDao {
    DBConnection DBConn = new DBConnection();

    public boolean Checklogin(String s1, String s2)
            throws SQLException {
        //
        Connection conn = DBConn.getConn();
        statement stmt = (statement) conn.createStatement();
        ResultSet rs = null;
        boolean OK = true;
        String sql = "select*from admin where" + "AdminName='" + s1 + "' and " + "AdminPwd='" + s2 + "'";
        rs = stmt.exeuteQuery(sql);
        if (!rs.next()) {
            OK = false;
        }
        return OK;
    }
}


